<?php
session_start();


$this->title = "My Posts";
$this->headTitle($this->title);
?>
<head>
    <?php echo $this->headLink()->prependStylesheet($this->baseUrl().'/css/index.css');?>
    <?php echo $this->headScript()->appendFile($this->baseUrl().'/../library/js/index.js');?>
</head>
<div id="index-wrap">

    <div class="medium-block index-object" name="post">

    
        <div class="bg-layer clickable-block posts">
            
            <div class="content-layer">
            </div>
            
            <div class="hover-layer">
                #posts
            </div>
            
            <div class="ctrl-layer">
            </div>
        </div>
        
    </div>
    
    <div class="medium-block index-object" name="blog">
        <div class="bg-layer blog">
            <div class="content-layer">
            </div>
            
            <div class="hover-layer">
                #blog
            </div>
            
            <div class="ctrl-layer">
            </div>
            
        </div>
    </div>

    <div class="medium-block index-object" name="projects">
        <div class="bg-layer clickable-block recent-works">
            <div class="content-layer">
            </div>
            
            <div class="hover-layer">
              #recent works
            </div>
            
            <div class="ctrl-layer">
            </div>
            
            
        </div>
    </div>
    <div class="medium-block index-object" name="contact">
        <div class="bg-layer clickable-block contact">
            <div class="content-layer">
            </div>
            
            <div class="hover-layer">
              #contact
            </div>
            
            <div class="ctrl-layer">
            </div>
        </div>
    </div>
    <?php
    if(!isset($_SESSION['username']))
    {
      echo '
      <div class="admin-login index-object">
        <form action="' . $this->url(array('controller'=>'index','action'=>'login')) . '" method="post">
          <div>
            <input type="text" name="cm-name" class="input-box" value="username">
            <input type="password" name="cm-pass" class="input-box" value="password">

            <input type="submit" value="Login" class="signup">
          </div>
        </form>
      </div>';
    }else{
      echo '
      <div class="admin-login index-object">
        Welcome back, '. $_SESSION['username'] .'
        <a href="' . $this->url(array('controller'=>'index','action'=>'logout')) . '">Sign Out</a>
      </div>
      ';
    }
    
    ?>
</div>